<?php 
// pr($this->Session->read("categoryPostList")); 
?>

<link rel="stylesheet" href="<?php echo $this->webroot;?>css/bootstrap-tagsinput.css"/>
<script type="text/javascript" src="<?php echo $this->webroot;?>js/typeahead.min.js"></script>    
<script type="text/javascript" src="<?php echo $this->webroot;?>js/bootstrap-tagsinput.min.js"></script>    
<div class="row">
    <div class="col-md-8 col-md-offset-2" style="background: #fff; padding-bottom: 50px;">
        <form role="form" name="Partner" method="post" action="<?php echo $this->webroot?>Post/save" >
          <input type="hidden" name="PostLang[ita][id]" value="" />
          <input type="hidden" name="PostLang[eng][id]" value="" />
          <input type="hidden" name="Post[id]" id="post_id" value="" />
          <input type="hidden" name="Post[status]" value='<?php echo POST_STATUS_DRAFT; ?>' />
	                    
		  <div class="row">
	           <div class="form-group  col-md-12">
	            <label for="lang_id">Categoria:</label><br>
	            <select style="width: 393px;" name="Post[categories_id]">
	                <?php foreach ($this->Session->read("categoryPostList") as $key => $categoryPost) { ?>
	                    <option value="<?php echo $key; ?>"><?php echo $categoryPost; ?></option>
	                <?php } ?>
	            </select>   
	          </div>
		  </div>
	                    
	                    
           <!-- Nav tabs -->
            <ul class="nav nav-tabs">
              <li class="active"><a href="#ita" data-toggle="tab">Ita</a></li>
              <li><a href="#eng" data-toggle="tab">Eng</a></li>
            </ul>
            
            <!-- Tab panes -->
            <div class="tab-content">
              <div class="tab-pane fade in active" id="ita">
              	
				  <div class="row">
			          <div class="form-group col-md-12">
			            <label for="nome">Titolo Italiano:</label>
			            <input type="text" class="form-control" name="PostLang[ita][title]" value="" placeholder="Inserisci il titolo">
			          </div>
			      </div>
				  <div class="row">
	                  <div class="form-group  col-md-12">
	                    <label for="descrizione">Articolo in Italiano:</label>
	                    <textarea rows="10" class="form-control" name="PostLang[ita][article]" ></textarea>
	                  </div>
			      </div>
                  
                  
              </div>
              <div class="tab-pane fade in" id="eng">
              	
				  <div class="row">
			          <div class="form-group col-md-12">
			            <label for="title">Titolo Inglese:</label>
			            <input type="text" class="form-control" name="PostLang[eng][title]" value="" placeholder="Inserisci il titolo">
			          </div>
			      </div>
				  <div class="row">
	                   <div class="form-group  col-md-12">
	                    <label for="article">Articolo in Inglese:</label>
	                    <textarea rows="10" class="form-control" name="PostLang[eng][article]" ></textarea>
	                  </div>
                  </div>
                  
              </div>
            </div>
          
          <div class="row">
	          <div class="col-md-12 pull-right" >
	              <button type="submit" class="btn btn-primary">Salva</button>
	              <a  href="<?php echo $this->webroot?>Post/index" class="btn">Annulla</a>
	          </div>
          </div>
          
        </form>
   </div>
  </div>